Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use AddressDomain for MayPointTo and ReachableFrom queries #1142

Merged
merged 58 commits into from
Sep 18, 2023
Merged

Conversation

karoliineh
Copy link
Member

@karoliineh karoliineh commented Aug 22, 2023

Changes

  1. Change MayPointTo and ReachableFrom query result from LS to AddressDomain. This has numerous benefits:

    1. Avoid lots of conversions when using these queries, e.g. ADLSAD/Set (Varinfo)/....
    2. LS had two different top representations (one for ToppedSet entirely and another when dummyFundec.svar was a member). The former allows no known pointers along with unknown pointer, the latter is easy to forget/not know about. AD has only one explicit representation by containing UnknownPtr.
    3. NullPtrs are not implicitly excluded from query results, allowing other analyses to know about them at all. For example, now we warn about unlocking NULL pointer.
    4. More precision due to fewer conversions. Addresses have ID indices which were dropped (if not definite) when converting to exp indices in LS. Now interval, etc offsets can be seen by other analyses.
  2. Fix unsoundness in analyses which previously forgot to check for dummyFundec in query results: relation, fileUse, poisonVariables, uninit, var_eq (in special).

TODO

  • Use MayPointToA and ReachableFromA in taintPartialContexts.
  • Remove queries with LS.
  • Add missing Address/Mval/Offset conversion functions.
  • Rename variables to match new type, e.g. lsad, lv → addr.
  • Review added TODOs in code.

@karoliineh karoliineh added cleanup Refactoring, clean-up type-safety Type-safety improvements precision labels Aug 22, 2023
@karoliineh karoliineh changed the title Use AddressDomain for queries Use AddressDomain for MayPointTo and ReachableFrom queries Aug 29, 2023
@karoliineh karoliineh mentioned this pull request Sep 1, 2023
5 tasks
@sim642 sim642 marked this pull request as ready for review September 11, 2023 14:40
@sim642 sim642 added this to the v2.3.0 milestone Sep 11, 2023
@sim642
Copy link
Member

sim642 commented Sep 15, 2023

@michael-schwarz Do you intend to review this again or was that all?

@michael-schwarz
Copy link
Member

It all seems reasonable at first glance, anything you would like me to look into in particular?

@sim642
Copy link
Member

sim642 commented Sep 15, 2023

Not really, I just wasn't sure since you left one small comment previously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Refactoring, clean-up precision type-safety Type-safety improvements unsound
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants